<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>超市账单管理系统</title>
    <link rel="stylesheet" href="/statics/css/public.css"/>
    <link rel="stylesheet" href="/statics/css/style.css"/>
    <script type="text/javascript" src="/statics/js/jquery.js"></script>
    <script type="text/javascript">
        $(function () {
            var date = new Date();
            var year = date.getFullYear();
            var mon = date.getMonth()+1;
            var day = date.getDate();
            var h = date.getHours();
            var m = date.getMinutes();
            var s = date.getSeconds();
            var week = date.getDay();
            switch (week){
                case 0:week="日";
                    break;
                case 1:week="一";
                    break;
                case 2:week="二";
                    break;
                case 3:week="三";
                    break;
                case 4:week="四";
                    break;
                case 5:week="五";
                    break;
                case 6:week="六";
                    break;
            }
            var str = year +"年"+mon+"月"+day+"日"+"&nbsp;"+h+":"+m+":"+s+"&nbsp;"+"星期"+week;
            $("#time").html(str);
            //判断当前时间
            var hour;
            if(h < 6){
                hour = "凌晨好!";
            } else if(h < 12){
                hour = "上午好!";
            } else if(h < 15){
                hour = "中午好!";
            } else if(h < 18){
                hour = "下午好!";
            } else if(h < 21){
                hour = "傍晚好!";
            } else {
                hour = "深夜好!";
            }
            $("#hour").html(hour);
        })
    </script>
</head>
<body>
<!--头部-->
<header class="publicHeader">
    <h1>超市账单管理系统</h1>
    <div class="publicHeaderR">
        <p><span id="hour"></span><span style="color: #fff21b"> ${loginUser.userName}</span> , 欢迎你！</p>
        <a href="/sys/user/logout" target="_top">退出</a>
    </div>
</header>
<!--时间-->
<section class="publicTime">
    <span id="time"></span>
    <a href="#">温馨提示：为了能正常浏览，请使用高版本浏览器！（IE10+）</a>
</section>
</body>
</html>
